package main.dao;

import main.view.Main;

import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.SQLException;

public class RegisterDB {
    public void register(String username,String password,String name,String grade,String college) throws SQLException {
        String sql="Insert into user (username,password,name,grade,college) values(?,?,?,?,?)";
        Connection con = new Main().getConnection();
        PreparedStatement ps=con.prepareStatement(sql);
        ps.setString(1,username);
        ps.setString(2,password);
        ps.setString(3,name);
        ps.setString(4,grade);
        ps.setString(5,college);
        ps.executeUpdate();
    }
}
